/*
 * @Author: funlee
 * @Email: i@funlee.cn
 * @Date: 2018-01-11 00:15:49
 * @Last Modified time: 2018-01-11 00:15:49
 * @Description: 正多边形 
 */
window.onload = function () {
  var canvas = document.querySelector('.canvas')
  var ctx = canvas.getContext('2d')

  createPolygon(ctx, 8, 250, 250, 100)
  ctx.fillStyle = 'Hotpink'
  ctx.fill()
}